home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / robo42_a.zip / QWKMAIL.RS < prev    next >
Text File  |  1992-07-23  |  4KB  |  136 lines

  1. TITLE "Special circumstance alternative QWK/REP mail run"
  2. ;----------------------------------------------------------------------
  3. ; QWKMAIL.RS -- Alternative to standard "G"et Mail and "S"end Replies
  4. ;......................................................................
  5. ;
  6. ; Author:  Dan Parsons
  7. ; Version: 1.0
  8. ; Revised: 4/24/92
  9. ;
  10. ; Notes:
  11. ;
  12. ;    * Should work fine for both Wildcat and PCBoard
  13. ;      MAKE SURE CORRECT PROMPT SET IS LOADED!
  14. ;
  15. ;    * DOES NOT check for insufficient time for transfer
  16. ;
  17. ; Why use this script?
  18. ;
  19. ;    * You are running a "His and Hers" install of Robocomm and want to
  20. ;      be able to do two mail runs to separate directories and need to
  21. ;      work around Robocomm's requirement of unique BBS IDs.
  22. ;
  23. ;    * You are a sysop and need to log in to do a net mail run using a
  24. ;      different BBS ID name and don't want to create a separate
  25. ;      Robocomm installation to do it.
  26. ;
  27. ;    * You want to drop carrier immediately after sending replies.
  28. ;
  29. ;    * You want to keep a separate log file of your mail run.
  30. ;
  31. ;----------------------------------------------------------------------
  32. ;
  33. ; BBS Macros used in this script:
  34. ;
  35. ;   40      Mail Door (TomCat) Command Prompt
  36. ;   41      Start Mail Download
  37. ;   42      Start Mail Upload
  38. ;   43      Packet Transfer Confirmation.
  39. ;   44      No Mail to Download
  40. ;
  41. ;----------------------------------------------------------------------
  42. PARAMETER 1 "Alternate BBS/QWK ID     (8 chars max)"
  43. PARAMETER 2 "Alternate QWK dir (include ending '\')"
  44. PARAMETER 3 "Alternate REP dir (include ending '\')"
  45. PARAMETER 4 "Hang up after sending REP        (Y/N)"
  46. PARAMETER 5 "Mail run log file           (optional)"
  47. ENDPARAMS
  48.  
  49.     ; Verify that the 3 necessary parameters were entered.
  50.     IF EMPTY "%P1%" GOTO PARAM_ERROR
  51.     IF EMPTY "%P2%" GOTO PARAM_ERROR
  52.     IF EMPTY "%P3%" GOTO PARAM_ERROR
  53.  
  54.     ; Set up capture file
  55.     ; Change "overwrite" below to "append" if desired.
  56.     IF NOT EMPTY "%P5%" CAPTURE "%P5%" OVERWRITE
  57.  
  58.     ; Default to ten minutes to scan for mail.
  59.     ; Edit this if desired.
  60.     TIMEOUT 600
  61.  
  62.     ; Get to mail door
  63.     VENUE MAIL
  64.  
  65.     ; Request the packet
  66.     SEND "D|"
  67.  
  68.     WHEN "%BBS43%" SEND "Y|"
  69.     WHEN "%BBS44%" GOTO SENDREP
  70.     WAITFOR "%BBS41%" FAILURE GOTO SLOW_BBS
  71.  
  72.     ; Keep 3 old QWK packets by default.
  73.     ; Edit this if desired.
  74.     IF EXIST "%P2%%P1%.QWK" RENUMBER "%P2%%P1%.QWK" 3
  75.  
  76.     ; Download the QWK packet.
  77.     MESSAGE "Downloading %P2%%P1%.QWK"
  78.     DOWNLOAD "%P2%%P1%.QWK" USING "%BBS22%"
  79.  
  80.     GOSUB GET_TO_COMMAND
  81.  
  82. GOTO SENDREP
  83.  
  84. :SENDREP
  85.     IF NOT EXIST "%P3%%P1%.REP" GOTO NOREP
  86.     SEND "U|"
  87.     WAITFOR "%BBS42%" FAILURE GOTO I_AM_LOST
  88.     MESSAGE "Uploading %P3%%P1%.REP"
  89.     UPLOAD "%P3%%P1%.REP" USING "%BBS21%"
  90.     ; Will keep up to 3 old rep packets.  Edit if desired.
  91.     RENUMBER "%P3%%P1%.REP" 3
  92. GOTO ENDRUN
  93.  
  94. :NOREP
  95.     MESSAGE "No %P3%%P1%.REP to send"
  96. GOTO ENDRUN
  97.  
  98. :ENDRUN
  99.     IF YES "%P5%" GOTO DROP_CARRIER
  100.     GOSUB GET_TO_COMMAND
  101.     CLOSE
  102. EXIT 0
  103.  
  104. :DROP_CARRIER
  105.     MESSAGE "Dropping carrier per request"
  106.     HANGUP
  107.     CLOSE
  108. EXIT 0
  109.  
  110. :GET_TO_COMMAND
  111.     SEND "|"
  112.     CLEAR
  113.     WHEN "%BBS32%" SEND "|"
  114.     WHEN "%BBS24%" SEND "|"
  115.     WAITFOR "%BBS40%" FAILURE GOTO I_AM_LOST
  116. RETURN
  117.  
  118. :SLOW_BBS
  119.     MESSAGE "^UERROR:^U Timeout during mail run."
  120.     HANGUP
  121.     CLOSE
  122. EXIT 1
  123.  
  124. :I_AM_LOST
  125.     MESSAGE "^UERROR:^U Sorry - I am lost."
  126.     HANGUP
  127.     CLOSE
  128. EXIT 1
  129.  
  130. :PARAM_ERROR
  131.     MESSAGE "^UERROR:^U Parameters 1, 2 and 3 are required!"
  132.     CLOSE
  133. EXIT 1
  134.  
  135. ;eof
  136.